package com.ahp.util;

import java.io.File;
import java.io.PrintWriter;

public class WirteFile {
	public boolean create(String content,String fileName){
		boolean b = false;
		try {
			File f = new File("\\file\\"+fileName+".txt");
			if(f.isFile()){
				System.out.println("文件已存在");
			}else{
				f.createNewFile();
				System.out.println("文件创建成功");
			}
			PrintWriter printwriter = new PrintWriter(f);
			printwriter.print(content);
			printwriter.close();
			b = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return b;
	}
	
}
